﻿Public Class NLocalidad


    Public Function guardarlocalidad(ByVal item As Entidades.ELocalidad) As Boolean
        Dim oDatos As New Datos.DLocalidad
        Dim oLocalidades As New List(Of Entidades.ELocalidad)
        Dim band As Boolean
        Try
            band = oDatos.guardar(item)
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
        Return band
    End Function

    Public Function eliminarlocalidad(ByVal item As Entidades.ELocalidad) As Boolean
        Dim oDatos As New Datos.DLocalidad
        Dim oLocalidades As New List(Of Entidades.ELocalidad)
        Dim band As Boolean
        Try
            band = oDatos.eliminar(item)
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
        Return band
    End Function
    

    Public Function modificar(ByVal localidad As Entidades.ELocalidad) As Boolean
        Dim oDatos As New Datos.DLocalidad
        Dim oLocalidades As New List(Of Entidades.ELocalidad)
        Dim band As Boolean
        Try
            band = oDatos.modificar(localidad)
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
        Return band
    End Function


    Public Function buscarlocalidad(ByVal texto As String) As DataTable

        Dim oDatos As New Datos.DLocalidad
        Try
            Return oDatos.buscarlocalidades(texto)
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
    End Function

    
End Class



